﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace RefOffDesktop
{
    /*
     * Class: VirtualPitchIncident
     * 
     * Use: Models an incident during a Match - consists
     *      of a Whistle event, the actual incident, time in 
     *      the Match it happened at, details of player involved,
     *      what the incident actually was and the distance between
     *      the incident and the referee (i.e. the whistle).
     *      Added to List of similar incidents for the Match so they
     *      can all be scrolled through when viewing the Virtual
     *      Pitch for the corresponding Match
     *      
     * Author: Mike Skaife, mcs3@aber.ac.uk
     */ 
    public class VirtualPitchIncident
    {
        //Details of the Virtual Pitch Incident
        String vpDistance;
        String vpIncident;
        String vpPlayer;
        String vpTime;
        String vpWhistleGPS;
        String vpIncidentGPS;
        int vpId;

        //Array of Points to be displayed on the Virtual Pitch, namely
        //the location of the whistle and the incident
        public List<Point> vpPoints;
        
        //Default constructor
        public VirtualPitchIncident()
        {
        }

        //Constructor to assign all variables for the Virtual Pitch Incident
        public VirtualPitchIncident(String theDistance, String theIncident, 
            String thePlayer, String theTime, String theWhistleGPS, String theIncidentGPS,
            Point theWhistlePoint, Point theIncidentPoint, int theVpId)
        {
            //Distance between whistle and incident
            this.vpDistance = theDistance;
            //Details of incident
            this.vpIncident = theIncident;
            //Player number, firstname and surname
            this.vpPlayer = thePlayer;
            //Time of incident in Match
            this.vpTime = theTime;
            //GPS location of whistle event
            this.vpWhistleGPS = theWhistleGPS;
            //GPS location of incident
            this.vpIncidentGPS = theIncidentGPS;
            //Create List to hold Points for displaying on Virtual Pitch
            this.vpPoints = new List<Point>();
            //Set id for incident
            this.vpId = theVpId;

            //Add whistle location and
            //incident location to List
            vpPoints.Add(theWhistlePoint);
            vpPoints.Add(theIncidentPoint);
        } 
        
        //Setter and getter for distance between whistle and incident
        public String distance
        {
            get
            {
                return vpDistance;
            }

            set
            {
                vpDistance = value;
            }
        }

        //Setter and getter for incident details
        public String incident
        {
            get
            {
                return vpIncident;
            }

            set
            {
                vpIncident = value;
            }
        }

        //Setter and getter for player details
        public String player
        {
            get
            {
                return vpPlayer;
            }

            set
            {
                vpPlayer = value;
            }
        }

        //Setter and getter for time of incident
        public String time
        {
            get
            {
                return vpTime;
            }

            set
            {
                vpTime = value;
            }
        }

        //Setter and getter for GPS location of whistle
        public String whistleGPS
        {
            get
            {
                return vpWhistleGPS;
            }

            set
            {
                vpWhistleGPS = value;
            }
        }

        //Setter and getter for GPS location of incident
        public String incidentGPS
        {
            get
            {
                return vpIncidentGPS;
            }

            set
            {
                vpIncidentGPS = value;
            }
        }

        //Setter and getter for id of incident
        public int id
        {
            get
            {
                return vpId;
            }

            set
            {
                vpId = value;
            }
        }
    }
}
